﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MSBDATAModel;

public partial class Admin_QLTaiKhoanWeb : System.Web.UI.Page
{
    MSBDATAEntities entities = new MSBDATAEntities();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GridView1.AutoGenerateColumns = false;

            // create column
            BoundField field = new BoundField();
            field.DataField = "TenDangNhap";
            field.HeaderText = "Tên đăng nhập";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "Ten";
            field.HeaderText = "Tên khách hàng";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "NgayTao";
            field.HeaderText = "Ngày tạo tài khoản";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "CMND";
            field.HeaderText = "CMND/Passport";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "Email";
            field.HeaderText = "Email";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "DienThoai";
            field.HeaderText = "Điện thoại";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "DiaChi";
            field.HeaderText = "Địa chỉ";
            GridView1.Columns.Add(field);

            field = new BoundField();
            field.DataField = "DuocKichHoat";
            field.HeaderText = "Trạng thái";
            GridView1.Columns.Add(field);

            GridView1.DataSource = entities.TAI_KHOAN_WEB;
            GridView1.DataBind();
        }

    }
}